﻿<phone:PhoneApplicationPage
    x:Class="TestApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:metroEventToCommand="clr-namespace:MetroEventToCommand;assembly=MetroEventToCommand"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="TEST APP" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock HorizontalAlignment="Center" Margin="0,20">Click to test</TextBlock>
            <!-- result label -->
            <TextBlock Grid.Column="1" HorizontalAlignment="Center" Margin="0,20">Result</TextBlock>

            <!-- Event with no parameters -->
            <Button Grid.Row="1" Content="No parameter" HorizontalAlignment="Center">
                <metroEventToCommand:EventToCommandManager.Collection>
                    <metroEventToCommand:EventToCommand Command="{Binding Test1Command}" Event="Click"></metroEventToCommand:EventToCommand>
                </metroEventToCommand:EventToCommandManager.Collection>
            </Button>
            <!-- Event with with parameters -->
            <Button Grid.Row="2" Content="Parameter" HorizontalAlignment="Center">
                <metroEventToCommand:EventToCommandManager.Collection>
                    <metroEventToCommand:EventToCommand Command="{Binding Test2Command}" CommandParameter="{Binding SimpleParam}" Event="Click" HandleEvent="True"></metroEventToCommand:EventToCommand>
                </metroEventToCommand:EventToCommandManager.Collection>
            </Button>
            <!-- Event with with event parameters (I understand myself) -->
            <Button Grid.Row="3" Content="Event parameter" HorizontalAlignment="Center">
                <metroEventToCommand:EventToCommandManager.Collection>
                    <metroEventToCommand:EventToCommand Command="{Binding Test3Command}" CommandParameter="{Binding SimpleParam}" Event="Click" />
                </metroEventToCommand:EventToCommandManager.Collection>
            </Button>

            <!-- Event with with event parameters (I understand myself) and non binding CommandParameter -->
            <Button Grid.Row="4" Content="Event parameter + non binding param" HorizontalAlignment="Center">
                <metroEventToCommand:EventToCommandManager.Collection>
                    <metroEventToCommand:EventToCommand Command="{Binding Test4Command}" CommandParameter="111" Event="Click" />
                </metroEventToCommand:EventToCommandManager.Collection>
            </Button>
           
            <!-- Results Columns -->
            <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Center">
                <TextBlock x:Name="Test1PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Passed</TextBlock>
                <TextBlock x:Name="Test1FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Failed</TextBlock>
            </StackPanel>

            <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Vertical" HorizontalAlignment="Center">
                <TextBlock x:Name="Test2PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Passed</TextBlock>
                <TextBlock x:Name="Test2FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Failed</TextBlock>
            </StackPanel>

            <StackPanel Grid.Column="1" Grid.Row="3" Orientation="Vertical" HorizontalAlignment="Center">
                <TextBlock x:Name="Test3PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Passed</TextBlock>
                <TextBlock x:Name="Test3FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Failed</TextBlock>
            </StackPanel>

            <StackPanel Grid.Column="1" Grid.Row="4" Orientation="Vertical" HorizontalAlignment="Center">
                <TextBlock x:Name="Test4PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Passed</TextBlock>
                <TextBlock x:Name="Test4FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeLarge}">Failed</TextBlock>
            </StackPanel>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>